package com.platform.enums;

import com.platform.comm.constants.EnumOption;
import com.platform.comm.enums.IEnumOption;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 *  共享类型
 */
@EnumOption(name = "shareType")
public enum ShareType implements IEnumOption<String> {
    /**
     * 共享
     */
    SHARE("SHARE", "共享"),
    /**
     * 上报
     */
    REPORT("REPORT", "上报");


    private String key;
    private String title;

    ShareType(String key, String title) {
        this.key = key;
        this.title = title;
    }

    /**
     * 枚举项 “键”
     *
     * @return key
     */
    @Override
    public String key() {
        return key;
    }

    /**
     * 枚举项 “值”
     *
     * @return value
     */
    @Override
    public String value() {
        return title;
    }

    /**
     * 枚举options
     *
     * @return
     */
    @Override
    public Map<String, String> enums() {
        return Arrays.stream(values()).collect(Collectors.toMap(IEnumOption::key, IEnumOption::value));
    }
}
